﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Reflection;
using Model;

public partial class JustTest : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //读取web.config中配置的key-value对
       string name =  ConfigurationManager.AppSettings["name"];
       string pass = ConfigurationManager.AppSettings["pass"];

       //ConfigurationSettings是已经过时的 已经被ConfigurationManager取代
       //string pass2 = ConfigurationSettings.AppSettings["pass"].ToString();

       msg.Text = name + " " + pass;// +" " + pass2;
    }
    protected void btnReflectTest_Click(object sender, EventArgs e)
    {
        //C#中不需要接口也可以直接代理
        //Assembly.Load("Model") 中Model貌似是项目名 而不是命名空间名 ？？？？？？？
        Student student = (Student)Assembly.Load("Model").CreateInstance("ExamOnLine.Model.Student");
        student.StuId = "z07041526";
        msg.Text = student.StuId;
    }
}
